package com.app;

import org.apache.commons.lang3.StringUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

import java.net.InetAddress;


@EnableScheduling
@SpringBootApplication
@ServletComponentScan(basePackages ="com.app.conf.SqlInjectFilter")
@MapperScan("com.app.mapper")
public class GasApplication {

	public static void main(String[] args) throws Exception{
        SpringApplication.run(GasApplication.class, args);

//		ConfigurableApplicationContext application = SpringApplication.run(GasApplication.class, args);
//		Environment env = application.getEnvironment();
//		String ip = InetAddress.getLocalHost().getHostAddress();
//		String port = env.getProperty("server.port");
//		String path = env.getProperty("server.servlet.context-path");
//		if (StringUtils.isEmpty(path)) {
//			path = "";
//		}
//		System.err.println("\n\t" +"Local访问网址: \t\thttp://localhost:" + port + path + "\n\t" +
//				"External访问网址: \thttp://" + ip + ":" + port + path);
	}
}
